//
//  FunctionController.swift
//  HHSwift
//
//  Created by 华宏 on 2019/1/24.
//  Copyright © 2019年 huahong. All rights reserved.
//

import UIKit

private let tableIdentifier = "tableIdentifier"

class FunctionHomeController: UIViewController,UITableViewDelegate,UITableViewDataSource {
   
    @IBOutlet weak var tableView: UITableView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
    }
    
    // MARK: UITableViewDataSource

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return dataArray.count
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell = tableView.dequeueReusableCell(withIdentifier: tableIdentifier, for: indexPath)
        cell.accessoryType = .disclosureIndicator
        cell.textLabel?.text = dataArray[indexPath.row]
        return cell
        
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
    {
        switch indexPath.row {
        case 0:
           let vc =  PickerViewController()
           vc.hidesBottomBarWhenPushed = true
           self.navigationController?.pushViewController(vc, animated: true)
        case 1:
            let vc =  DatePickerController()
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        case 2:
            let moveVC = MoveCollectionController()
            moveVC.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(moveVC, animated: true)
        case 3:
             let waterfallVC = WaterfallController()
             waterfallVC.hidesBottomBarWhenPushed = true
             self.navigationController?.pushViewController(waterfallVC, animated: true)
        case 4:
            let vc =  MVVMController()
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        case 5:
            let storyBoard = UIStoryboard(name: "Main", bundle: Bundle.main)
            let vc = storyBoard.instantiateViewController(withIdentifier: "HHVideoPlayController")
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        case 6:
            let vc =  QKThreeLinkageController()
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        case 7:
            let vc =  SearchViewController()
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        case 8:
            let vc =  FontViewController()
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        case 9:
            let vc =  MapViewController()
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        case 10:
            let vc =  ContactsController()
            vc.hidesBottomBarWhenPushed = true
            self.navigationController?.pushViewController(vc, animated: true)
        default:
          print("")
        }
    }

   //MARK: - 
    lazy var dataArray: [String] = {
        return ["PickerView","DatePicker","Cell移动","瀑布流","MVVM","视频播放","三级联动","搜索","字体","地图","通讯录"]
    }()
    
    //返回元组
    func returnTumple() -> (result1:String,result2:[Any]) {
        
        return("111",[""])
    }
    
  
    
    
}
